<!--
  layout组件：展开抽屉组件
-->
<template>
  <div class="console-box" @click="skipToConsoleLogin" v-if="sa.$sys.getCurUser().id">
    <svg-icon icon-class="right_circle_0"></svg-icon>
  </div>
</template>

<script>
import settings from '@/settings'
export default {
  name: 'ConsoleButton',
  data() {
    return {}
  },
  methods: {
    skipToConsoleLogin() {
      let _this = this;
      _this.$router.push({
        path: settings.login_url,
        query: {
          s: 'console'
        }
      })
    },
  }
}
</script>

<style lang="scss" scoped>
@import '@/styles/mixin.scss';

.console-box {
  @include flex-center;
  position: fixed;
  width: 56px;
  height: 56px;
  right: 0;
  bottom: 8%;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50% 0 0 50%;
  cursor: pointer;
  z-index: 99;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(28px);
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(160, 160, 160, 0.1);

  &::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50% 0 0 50%;
    background: radial-gradient(circle, rgba(0, 179, 255, 0.1) 10%, transparent 10.01%);
    transform: scale(0);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
  }

  .svg-icon {
    width: 24px;
    height: 24px;
    transition: color 0.2s;
    color: #0099cc;
  }
}

.console-box:hover {
  transform: translateX(0) scaleX(1.0);
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);

  &::after {
    opacity: 1;
    transform: scale(1.1);
  }
}
</style>
